#include <hls_opencv.h>
#include "sobel.hpp"
#include <iostream>
using namespace std;

int main (int argc, char** argv) 
{
	IplImage* src;
	IplImage* dst;
	AXI_STREAM src_axi, dst_axi;
	src = cvLoadImage("/home/zhangjm/vivado_prj/sobel/data/test.bmp");
	cout <<"src->depth = " << src->depth << endl;
	cout <<"src->nChannels = " << src->nChannels << endl;

	dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels);
	IplImage2AXIvideo(src, src_axi);
	while(!src_axi.empty()) 
	{ 
		image_filter(src_axi, dst_axi);
	}
	
	AXIvideo2IplImage(dst_axi, dst);
	cvSaveImage("/home/zhangjm/vivado_prj/sobel/data/out.bmp", dst);
	cout<<"finish!" <<endl;
	cvReleaseImage(&src);
	cvReleaseImage(&dst);
}

